home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / PCI.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  5.4 KB  |  170 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        PCI.p
  3.  
  4.      Contains:    PCI Bus Interfaces.
  5.  
  6.      Version:    Technology:    PowerSurge 1.0.2
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1993-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT PCI;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __PCI__}
  28. {$SETC __PCI__ := 1}
  29.  
  30. {$I+}
  31. {$SETC PCIIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __NAMEREGISTRY__}
  38. {$I NameRegistry.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46. {  Types and structures for accessing the PCI Assigned-Address property. }
  47.  
  48.  
  49. CONST
  50.     kPCIRelocatableSpace        = $80;
  51.     kPCIPrefetchableSpace        = $40;
  52.     kPCIAliasedSpace            = $20;
  53.     kPCIAddressTypeCodeMask        = $03;
  54.     kPCIConfigSpace                = 0;
  55.     kPCIIOSpace                    = 1;
  56.     kPCI32BitMemorySpace        = 2;
  57.     kPCI64BitMemorySpace        = 3;
  58.  
  59.  
  60. TYPE
  61.     PCIAddressSpaceFlags                = UInt8;
  62.  
  63. CONST
  64.     kPCIDeviceNumberMask        = $1F;
  65.     kPCIFunctionNumberMask        = $07;
  66.  
  67.  
  68. TYPE
  69.     PCIDeviceFunction                    = UInt8;
  70.     PCIBusNumber                        = UInt8;
  71.     PCIRegisterNumber                    = UInt8;
  72.     PCIAssignedAddressPtr = ^PCIAssignedAddress;
  73.     PCIAssignedAddress = PACKED RECORD
  74.         addressSpaceFlags:        PCIAddressSpaceFlags;
  75.         busNumber:                PCIBusNumber;
  76.         deviceFunctionNumber:    PCIDeviceFunction;
  77.         registerNumber:            PCIRegisterNumber;
  78.         address:                UnsignedWide;
  79.         size:                    UnsignedWide;
  80.     END;
  81.  
  82.  
  83. FUNCTION EndianSwap16Bit(data16: UInt16): UInt16;
  84.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  85.     INLINE $301F, $E158, $3E80;
  86.     {$ENDC}
  87. FUNCTION EndianSwap32Bit(data32: UInt32): UInt32;
  88.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  89.     INLINE $201F, $E158, $4840, $E158, $2E80;
  90.     {$ENDC}
  91. FUNCTION ExpMgrConfigReadByte(node: RegEntryIDPtr; configAddr: LogicalAddress; VAR valuePtr: UInt8): OSErr;
  92.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  93.     INLINE $303C, $0620, $AAF3;
  94.     {$ENDC}
  95. FUNCTION ExpMgrConfigReadWord(node: RegEntryIDPtr; configAddr: LogicalAddress; VAR valuePtr: UInt16): OSErr;
  96.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  97.     INLINE $303C, $0621, $AAF3;
  98.     {$ENDC}
  99. FUNCTION ExpMgrConfigReadLong(node: RegEntryIDPtr; configAddr: LogicalAddress; VAR valuePtr: UInt32): OSErr;
  100.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  101.     INLINE $303C, $0622, $AAF3;
  102.     {$ENDC}
  103. FUNCTION ExpMgrConfigWriteByte(node: RegEntryIDPtr; configAddr: LogicalAddress; value: ByteParameter): OSErr;
  104.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  105.     INLINE $303C, $0523, $AAF3;
  106.     {$ENDC}
  107. FUNCTION ExpMgrConfigWriteWord(node: RegEntryIDPtr; configAddr: LogicalAddress; value: UInt16): OSErr;
  108.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  109.     INLINE $303C, $0524, $AAF3;
  110.     {$ENDC}
  111. FUNCTION ExpMgrConfigWriteLong(node: RegEntryIDPtr; configAddr: LogicalAddress; value: UInt32): OSErr;
  112.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  113.     INLINE $303C, $0625, $AAF3;
  114.     {$ENDC}
  115. FUNCTION ExpMgrIOReadByte(node: RegEntryIDPtr; ioAddr: LogicalAddress; VAR valuePtr: UInt8): OSErr;
  116.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  117.     INLINE $303C, $0626, $AAF3;
  118.     {$ENDC}
  119. FUNCTION ExpMgrIOReadWord(node: RegEntryIDPtr; ioAddr: LogicalAddress; VAR valuePtr: UInt16): OSErr;
  120.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  121.     INLINE $303C, $0627, $AAF3;
  122.     {$ENDC}
  123. FUNCTION ExpMgrIOReadLong(node: RegEntryIDPtr; ioAddr: LogicalAddress; VAR valuePtr: UInt32): OSErr;
  124.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  125.     INLINE $303C, $0628, $AAF3;
  126.     {$ENDC}
  127. FUNCTION ExpMgrIOWriteByte(node: RegEntryIDPtr; ioAddr: LogicalAddress; value: ByteParameter): OSErr;
  128.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  129.     INLINE $303C, $0529, $AAF3;
  130.     {$ENDC}
  131. FUNCTION ExpMgrIOWriteWord(node: RegEntryIDPtr; ioAddr: LogicalAddress; value: UInt16): OSErr;
  132.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  133.     INLINE $303C, $052A, $AAF3;
  134.     {$ENDC}
  135. FUNCTION ExpMgrIOWriteLong(node: RegEntryIDPtr; ioAddr: LogicalAddress; value: UInt32): OSErr;
  136.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  137.     INLINE $303C, $062B, $AAF3;
  138.     {$ENDC}
  139. FUNCTION ExpMgrInterruptAcknowledgeReadByte(entry: RegEntryIDPtr; VAR valuePtr: UInt8): OSErr;
  140.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  141.     INLINE $303C, $0411, $AAF3;
  142.     {$ENDC}
  143. FUNCTION ExpMgrInterruptAcknowledgeReadWord(entry: RegEntryIDPtr; VAR valuePtr: UInt16): OSErr;
  144.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  145.     INLINE $303C, $0412, $AAF3;
  146.     {$ENDC}
  147. FUNCTION ExpMgrInterruptAcknowledgeReadLong(entry: RegEntryIDPtr; VAR valuePtr: UInt32): OSErr;
  148.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  149.     INLINE $303C, $0413, $AAF3;
  150.     {$ENDC}
  151. FUNCTION ExpMgrSpecialCycleWriteLong(entry: RegEntryIDPtr; value: UInt32): OSErr;
  152.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  153.     INLINE $303C, $0419, $AAF3;
  154.     {$ENDC}
  155. FUNCTION ExpMgrSpecialCycleBroadcastLong(value: UInt32): OSErr;
  156.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  157.     INLINE $303C, $021A, $AAF3;
  158.     {$ENDC}
  159.  
  160. {$ALIGN RESET}
  161. {$POP}
  162.  
  163. {$SETC UsingIncludes := PCIIncludes}
  164.  
  165. {$ENDC} {__PCI__}
  166.  
  167. {$IFC NOT UsingIncludes}
  168.  END.
  169. {$ENDC}
  170.